package com.fandy.struts.SqlStatement;

public class Outgoing {
 
	public   String  getAll()
	{
		return   "select * from Outgoing";
	}
	
	public   String getOutInfoByID(int ID)
	{
		return  "select * from Outgoing where " +com.fandy.struts.Meta.Outgoing.getOutgoingid()+"="+ID;
	}
	
	
	public String Add(com.fandy.struts.Model.Outgoing og)
	{
		
		return "insert into Outgoing values ("
		+ "'" + og.getClientid()+"',"		 
		+ "'" +og.getGoodsid()+"',"
		+ "'"  + og.getOperator() + "',"
		+ "'"  + og.getOutgoingid() + "',"
		+ "'"  + og.getQuantity() + "',"
		+ "'"  + og.getRemark()+ "',"
		+ "'"  + og.getUnitprice() + "',"
		+ "'"  + og.getDate() + "',"		
		+")"
		;
		
	}
	
	
	
	
	
	public String UpdateByID(int id,com.fandy.struts.Model.Outgoing s)
	{
		
		return "update Outgoing set "+com.fandy.struts.Meta.Outgoing.getClientid()
		+"='" + s.getClientid()+"',"		 
		+com.fandy.struts.Meta.Outgoing.getDate()+"='" +s.getDate()+"',"
		+com.fandy.struts.Meta.Outgoing.getGoodsid()+ "='"  + s.getGoodsid() + "',"
		+com.fandy.struts.Meta.Outgoing.getOperator()+ "='"  + s.getOperator() + "',"
		
		+com.fandy.struts.Meta.Outgoing.getQuantity() + "='"  + s.getQuantity() + "',"
		+com.fandy.struts.Meta.Outgoing.getRemark() + "='"  + s.getRemark()+ "'"
		+com.fandy.struts.Meta.Outgoing.getUnitprice() + "='"  + s.getUnitprice()+ "'"
		+"where "+com.fandy.struts.Meta.Outgoing.getOutgoingid()+"="+id;
		
	}
	
	public String DeleteByID(int id)
	{
		
		return "delete from Outgoing where " + com.fandy.struts.Meta.Outgoing.getOutgoingid() +"="+id;
		
	}
	
	
	
}

